package com.expressage.service.impl;
import com.expressage.dao.PackageDao;
import com.expressage.dao.UserDao;
import com.expressage.po.Package;
import com.expressage.po.User;
import com.expressage.service.UserService;
import com.expressage.vo.PackageVO;
import com.expressage.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户业务逻辑实现
 */

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;
    PackageDao packageDao;

    @Override
    public List<UserVO> findAll() {
        return userDao.findAll();
    }

    @Override
    public User findById(int uid) {
        return userDao.findById(uid);
    }

    @Override
    public User findByTelAndPass(User user) {
        return userDao.findByTelAndPass(user);
    }

    @Override
    public List<User> findByRid(int rid) {
        return userDao.findByRid(rid);
    }

    @Override
    public List<User> find(User user) {
        return userDao.find(user);
    }

    @Override
    public boolean addUser(User user) {
        return userDao.addUser(user)>0?true:false;
    }

    @Override
    public boolean updateUser(User user) {
        return userDao.updateUser(user)>0?true:false;
    }

    @Override
    public boolean deleteUser(int[] arrays) {
        return userDao.deleteUser(arrays)>0?true:false;
    }


}
